<#assign treeroleid=auth.getuuid()>
<script type="text/javascript">
function saverole_menu(){
	var zTree = $.fn.zTree.getZTreeObj("treeroleid")
    var menus = zTree.getNodes();
	$("#treeroleid").bjuiajax('doAjax', {url:"${rootpath}/System/role_menu_save",confirmMsg:"是否确定需要保存？",data:{'menus':JSON.stringify(menus[0]),'roleid':"${roleid!}"}});
}
</script>
<#if auth.getauth(userid,"/System/role_menu_save")>
<button class="btn btn-green" onclick="saverole_menu();">保存菜单权限</button>
</#if>
<ul id="treeroleid" class="ztree" data-toggle="ztree" data-max-add-level="4" data-expand-level="2"
	data-expand-all="false" data-check-enable="true">
	<#list menulist as item>
		<#if item?exists>
		<li data-id="${item.id!}" data-pid="${item.pid!}"
		data-tsid="${item.id!}" data-tspid="${item.pid!}" 
		data-checked="${item.checked}">${item.text}</li>
		</#if> 
	</#list>
</ul>